package com.vivo.module.criteria.config;

import com.vivo.module.criteria.CriteriaValidator;
import com.vivo.module.criteria.PublicCriteriaMetaData;
import com.vivo.module.criteria.SimpleCriteriaMetaData;

/**
 * Criteria Meta.
 * 
 * @author vivo
 * @2007-12-12
 */
public class CriteriaMeta {

	@SuppressWarnings("unchecked")
	public static Basic basic = new Basic("");

	@SuppressWarnings("unchecked")
	public static User user = new User("");

	/**
	 * Basic Criteria.
	 */
	public static class Basic<V> extends PublicCriteriaMetaData<V> {
		public Basic(String key) {
			super(key);
		}

		public Basic(String key, CriteriaValidator<V> validator) {
			super(key, validator);
		}
		public static Basic<Integer> ApplicationId = new Basic<Integer>("applicationId",
		        Validator.intIdValidator);
		public static Basic<String> ApplicationName = new Basic<String>("applicationName");
	}

	/**
	 * User Criteria.
	 */
	public static class User<V> extends SimpleCriteriaMetaData<User<V>, V> {
		public User(String key) {
			super(key);
		}

		public User(String key, CriteriaValidator validator) {
			super(key, validator);
		}
		public static User<Integer> userId = new User<Integer>("userId");
		public static User<String> email = new User<String>("email");
		// ...
	}

	/**
	 * User Criteria.
	 */
	public static class User2<V> extends User<V> {
		public User2(String key) {
			super(key);
		}

		public User2(String key, CriteriaValidator validator) {
			super(key, validator);
		}
		public static User2<Integer> userId = new User2<Integer>("userId");
		public static User2<String> email = new User2<String>("email");
		// ...
	}
}
